using HKB.Common;
using System;
using System.Data;
namespace HKB.Web.Shop
{
	public class TextFormat
	{
		public static string GetOrderStatus(string m_status, string Reviced)
		{
			string result;
			if (m_status != null)
			{
				if (m_status == "0")
				{
					result = Language.GetMemberMsg("Order/OrderStatus0", new string[0]);
					return result;
				}
				if (m_status == "1")
				{
					result = Language.GetMemberMsg("Order/OrderStatus1", new string[0]);
					return result;
				}
				if (!(m_status == "2"))
				{
					if (m_status == "4")
					{
						result = Language.GetMemberMsg("Order/OrderStatus4", new string[0]);
						return result;
					}
				}
				else
				{
					if (Reviced == "1")
					{
						result = Language.GetMemberMsg("Order/OrderStatus2", new string[0]);
						return result;
					}
					result = Language.GetMemberMsg("Order/OrderStatus2", new string[0]);
					return result;
				}
			}
			result = "";
			return result;
		}
		public static string GetPayCheckStatus(string m_status)
		{
			string result;
			if (m_status != null)
			{
				if (m_status == "0")
				{
					result = Language.GetMemberMsg("Order/Auction/Status/Status0", new string[0]);
					return result;
				}
				if (m_status == "1")
				{
					result = Language.GetMemberMsg("Order/Auction/Status/Status1", new string[0]);
					return result;
				}
				if (m_status == "2")
				{
					result = Language.GetMemberMsg("Order/Auction/Status/Status3", new string[0]);
					return result;
				}
			}
			result = "";
			return result;
		}
		public static string GetTeamOrderStatus(string m_status)
		{
			string result;
			if (m_status != null)
			{
				if (m_status == "0")
				{
					result = Language.GetMemberMsg("Order/TeamBuy/Status/Status0", new string[0]);
					return result;
				}
				if (m_status == "1")
				{
					result = Language.GetMemberMsg("Order/TeamBuy/Status/Status1", new string[0]);
					return result;
				}
				if (m_status == "2")
				{
					result = Language.GetMemberMsg("Order/TeamBuy/Status/Status2", new string[0]);
					return result;
				}
				if (m_status == "3")
				{
					result = Language.GetMemberMsg("Order/TeamBuy/Status/Status3", new string[0]);
					return result;
				}
			}
			result = "";
			return result;
		}
		public static string GetPayStatus(string m_status)
		{
			string result;
			if (m_status != null)
			{
				if (m_status == "0")
				{
					result = Language.GetMemberMsg("Order/PayStatus0", new string[0]);
					return result;
				}
				if (m_status == "1")
				{
					result = Language.GetMemberMsg("Order/PayStatus1", new string[0]);
					return result;
				}
				if (m_status == "2")
				{
					result = Language.GetMemberMsg("Order/PayStatus2", new string[0]);
					return result;
				}
			}
			result = "";
			return result;
		}
		public static string GetDeliverStatus(string m_status)
		{
			string result;
			if (m_status != null)
			{
				if (m_status == "0")
				{
					result = Language.GetMemberMsg("Order/DeliverStatus0", new string[0]);
					return result;
				}
				if (m_status == "1")
				{
					result = Language.GetMemberMsg("Order/DeliverStatus1", new string[0]);
					return result;
				}
				if (m_status == "2")
				{
					result = Language.GetMemberMsg("Order/DeliverStatus2", new string[0]);
					return result;
				}
				if (m_status == "4")
				{
					result = Language.GetMemberMsg("Order/DeliverStatus4", new string[0]);
					return result;
				}
				if (m_status == "-1")
				{
					result = "已退货";
					return result;
				}
				if (m_status == "-2")
				{
					result = "退货完毕";
					return result;
				}
			}
			result = "";
			return result;
		}
		public static string GetProductType(string m_type)
		{
			string result;
			if (m_type != null)
			{
				if (m_type == "1")
				{
					result = Language.Get("Shop/Product/ProductType1");
					return result;
				}
				if (m_type == "2")
				{
					result = Language.Get("Shop/Product/ProductType2");
					return result;
				}
				if (m_type == "3")
				{
					result = Language.Get("Shop/Product/ProductType3");
					return result;
				}
				if (m_type == "4")
				{
					result = Language.Get("Shop/Product/ProductType4");
					return result;
				}
				if (m_type == "5")
				{
					result = Language.Get("Shop/Product/ProductType5");
					return result;
				}
			}
			result = "";
			return result;
		}
		public static string GetPay(string m_status)
		{
			string result;
			if (m_status.ToLower() == "pay")
			{
				result = Language.Get("Shop/PayInfo/PayStatus/Pay");
			}
			else
			{
				if (m_status == "NotPaySaler")
				{
					result = Language.Get("Shop/PayInfo/PayStatus/NotPaySaler");
				}
				else
				{
					result = Language.Get("Shop/PayInfo/PayStatus/NotPay");
				}
			}
			return result;
		}
		public static string GetBank(string m_type)
		{
			string result;
			if (m_type.ToLower() == "shopbank")
			{
				result = Language.Get("Shop/PayInfo/PayEBank/ShopBank");
			}
			else
			{
				if (m_type.ToLower() == "alipay")
				{
					result = Language.Get("Shop/PayInfo/PayEBank/AliPay");
				}
				else
				{
					if (m_type.ToLower() == "trafutonQ")
					{
						result = Language.Get("Shop/PayInfo/PayEBank/TrafutonQ");
					}
					else
					{
						if (m_type.ToLower() == "vip")
						{
							result = Language.Get("Shop/PayInfo/PayEBank/VipCard");
						}
						else
						{
							if (m_type.ToLower() == "gift")
							{
								result = Language.Get("Shop/PayInfo/PayEBank/GiftCard");
							}
							else
							{
								if (m_type.ToLower() == "lottery")
								{
									result = Language.Get("Shop/PayInfo/PayEBank/LotteryCard");
								}
								else
								{
									result = Language.Get("Shop/PayInfo/PayEBank/DownLine");
								}
							}
						}
					}
				}
			}
			return result;
		}
		public static string GetVentify(string str)
		{
			string result;
			if (str != null)
			{
				if (str == "0")
				{
					result = Language.GetMemberMsg("Ventify/CheckType/Type0", new string[0]);
					return result;
				}
				if (str == "1")
				{
					result = Language.GetMemberMsg("Ventify/CheckType/Type1", new string[0]);
					return result;
				}
				if (str == "9")
				{
					result = Language.GetMemberMsg("Ventify/CheckType/Type9", new string[0]);
					return result;
				}
				if (str == "-1")
				{
					result = Language.GetMemberMsg("Ventify/CheckType/Type-1", new string[0]);
					return result;
				}
			}
			result = "";
			return result;
		}
		public static string GetProductStandard(string productStandard)
		{
			string result;
			if (productStandard != null)
			{
				if (productStandard == "0")
				{
					result = "二手";
					return result;
				}
				if (productStandard == "1")
				{
					result = "全新";
					return result;
				}
			}
			result = "";
			return result;
		}
		public static string GetPayType(string str)
		{
			string result;
			if (str == "0")
			{
				result = Language.Get("Shop/PayType/payTypeName0");
			}
			else
			{
				if (str == "1")
				{
					result = Language.Get("Shop/PayType/payTypeName1");
				}
				else
				{
					if (str == "2")
					{
						result = Language.Get("Shop/PayType/payTypeName2");
					}
					else
					{
						result = "";
					}
				}
			}
			return result;
		}
		public static string GetReceived(string OrderID)
		{
			Conn conn = new Conn();
			DataSet dataSet = conn.GetDataSet("select Received from HLShop_DeliverItem where OrderID=" + int.Parse(OrderID));
			string result;
			if (dataSet != null && dataSet.Tables[0].Rows.Count > 0)
			{
				result = dataSet.Tables[0].Rows[0]["Received"].ToString();
			}
			else
			{
				result = "0";
			}
			return result;
		}
		public static string GetStatus(object value)
		{
			string result = value.ToString();
			if (value.ToString().ToLower().Trim() == "true")
			{
				result = "<span style='color:Green;'>√</span>";
			}
			else
			{
				if (value.ToString().ToLower().Trim() == "false")
				{
					result = "<span style='color:Red;'>×</span>";
				}
			}
			return result;
		}
	}
}
